<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      #box {
        font-size: 40px;
        border: 20px solid goldenrod;
        padding: 20px;
        background-color: bisque;
        background-clip: content-box;
        height: 300px;
        width: 300px;
      }

      #box p {
        height: 200px;
        border: solid;
      }
    </style>
  </head>
  <body>
    <div id="box" style="color: red">
      <p>hello box1</p>
      <p>hello box2</p>
      <p>hello box3</p>
      <p>hello box4</p>
      <p>hello box5</p>
      <p>hello box6</p>
    </div>
    <script>
      const box = document.getElementById("box");
      console.log("offsetHeight", box.offsetHeight);
      console.log("offsetWidth", box.offsetWidth);
      //---
      console.log("clientHeight", box.clientHeight);
      console.log("clientWidth", box.clientWidth);
    </script>
  </body>
</html>
